package com.sne.airways.system.utils;

import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;

import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: 卞京帅{bjslogin@gmail.com}
 * Date: 12-11-20
 * Time: 下午10:10
 * To change this template use File | Settings | File Templates.
 */
public class PojoHelper {

    /**
     * 设置基础数据
     * @param o
     */
    public static void setBaseProperties(Object o){
        BeanWrapper wrapper = new BeanWrapperImpl(o);
        wrapper.setPropertyValue("createDate",new Date());
        wrapper.setPropertyValue("modifyDate",new Date());
        wrapper.setPropertyValue("createUser",AppUtils.getCurrentUser().getUserId());
        wrapper.setPropertyValue("modifyUser",AppUtils.getCurrentUser().getUserId());
    }
}
